import time
from machine import SPI, Pin
from driver import st7789_spi
from lib.easydisplay import EasyDisplay


spi = SPI(1, baudrate=20000000, polarity=0, phase=0, sck=Pin(10), mosi=Pin(8))
dp = st7789_spi.ST7789(width=320, height=240, spi=spi, cs=2, dc=4, res=6, rotate=2, bl=1,invert=False, rgb=False)

sm= EasyDisplay(display=dp, font="/text_full_16px_2312.v3.bmf", show=True, color=0xFFFF, auto_wrap=True, clear=True,color_type="RGB565")

bg = EasyDisplay(display=dp, font="/text_full_24px_2312.v3.bmf", show=True, color=0xFFFF, auto_wrap=True, clear=True,color_type="RGB565")

sm.text("小字体", 0, 0)
bg.text("大字体", 0, 30,clear=False)

time.sleep(3)

bg.clear()
#全部清除
bg.text("大字体", 0, 60,bg_color=0x0F0 )

bg.text("大字体", 80, 60,bg_color=0x0F0,color=0x00F,clear=False)
